package com.bbcare.followup.plat.store.ibatis;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.bbcare.followup.plat.entity.PatientContentData;
import com.bbcare.followup.plat.entity.PatientTaskContent;
import com.bbcare.followup.plat.entity.PtTaskContentRd;
import org.apache.ibatis.annotations.Param;

/**
 * @name: 患者任务内容存储接口
 * @author: DemonLee
 * @createTime: 2017.4.13
 * @description: 患者任务内容
 * @modify:
 * 
 */
public interface IPatientTaskContentDAO {
    /**
     * 批量插入患者任务内容
     * 
     * @param pt
     * @return
     */
    public void savePatientTaskContentBatch(List<PatientTaskContent> pt) throws Exception;

    /**
     * 批量插入患者任务内容详情
     * 
     * @param pt
     * @return
     */
    public void savePatientTaskContentDataBatch(List<PatientContentData> pt) throws Exception;

    /**
     * 批量插入患者任务内容详情历史记录表
     * 
     * @param pt
     * @return
     */
    public void savePatientTaskContentDataHisBatch(List<PatientContentData> pt) throws Exception;

    /**
     * 查询患者任务内容list
     * 
     * @param paramMap
     * @return list
     */
    public List<PatientTaskContent> selectContentByTaskId(Map<String, Object> paramMap) throws Exception;

    /**
     * 查询患者任务内容list
     * 
     * @param paramMap
     * @return list
     */
    public List<PatientContentData> selectContentDataByTaskId(Map<String, Object> paramMap) throws Exception;

    /**
     * 查询患者任务内容list
     * 
     * @param paramMap
     * @return list
     */
    public List<PatientContentData> listCntDataByUserIdAndAccept(Map<String, Object> paramMap) throws Exception;

    /**
     * 更新任务内容详情
     * 
     * @param pt
     * @return int
     */
    public int updatePatientTaskContentDataInfo(PatientContentData pt) throws Exception;

    /**
     * 更新任务内容详情
     * 
     * @param paramMap
     * @return int
     */
    public int updatePtContentDataInfoByConDt(Map<String, Object> paramMap) throws Exception;

    /**
     * 任务内容详情历史轨迹记录
     * 
     * @param paramMap
     * @return
     */
    public void insertContentDataHis(HashMap<String, Object> paramMap) throws Exception;

    /**
     * 更新任务内容
     * 
     * @param paramMap
     * @return
     */
    public int updateTaskContentById(HashMap<String, Object> paramMap) throws Exception;

    /**
     * 任务内容记录流水
     * 
     * @param rd
     * @return
     */
    public void insertTaskContentRd(PtTaskContentRd rd) throws Exception;

    /**
     * 查询患者任务内容list
     * 
     * @param paramMap
     * @return list
     */
    public List<PatientContentData> selectCntDataHisByTaskIdAndAccept(Map<String, Object> paramMap) throws Exception;

    
    /**
     * 查询患者任务内容list
     * 
     * @param paramMap
     * @return list
     */
    public List<PatientContentData> listCntDataByUserIdAndAcceptPrivate(Map<String, Object> paramMap) throws Exception;

    
    /**
     * 删除答案内容
     * 
     * @param pt
     * @return 
     */
	public void deletePtContentDataInfoByConDt(PatientContentData pt) throws Exception;
	
	//查询身高体重头围 问题内容
    List<Map<String,Object>> selectPtContentDataGrowthRecord(Map<String, Object> paramMap) throws Exception;
    
    //更新身高体重头围 百分位题目 答案
    void updateContentDataGrowthStandard(Map<String, Object> paramMap) throws Exception;
    
    //查询主诉任务
    public List<Map<String,Object>> selectPtTaskInfo(Map<String, Object> paramMap) throws Exception;
    
    //查询主诉任务
    public List<PatientContentData> selectContentDataByTaskIdOr(Map<String, Object> paramMap) throws Exception;
    
    /**
     * 查询当前科研id是否被使用
     */
    public int selectQustionAnswer(Map<String, Object> paramMap) throws Exception; 
    /**
     * 删除任务内容
     * 
     * @param taskId
     * @return 
     */
	public void deletePtContentDataInfoByTaskId(String taskId) throws Exception;

	public void updateBatchPatientContentData(List<PatientContentData> list)throws Exception;

	//根据病人号查询结果集.
    public List<PatientContentData> selectBRH(Map<String, Object> paramMap) throws Exception;

    /**
     * 更新问卷答案
     * @param paramMap 请求参数
     */
    int updateAnswerByTenantIdAndUserIdAndQuestionId(Map<String, Object> paramMap);

    /**
     * 修改患者的床号。
     * @param contentData
     * @return
     * @throws Exception
     */
    int updatePatientBedNo(final PatientContentData contentData) throws Exception;
    /**
     * 修改患者的住院号。
     * @param contentData
     * @return
     * @throws Exception
     */
    int updatePatientHospitalNo(final PatientContentData contentData) throws Exception;


    List<PatientContentData> listByCondition(Map<String,Object> paramMap);


    int insertContentDataBatch(@Param("list") List<PatientContentData> insertList);
}
